package section10;

import java.io.*;

public class App10_8 {
    public static void main(String[] args)throws IOException, FileNotFoundException {
        String str=new String();
        try(
                BufferedReader in=new BufferedReader(new FileReader("C:\\Users\\Administrator\\Desktop\\text.txt"));
                BufferedWriter out=new BufferedWriter(new FileWriter("C:\\Users\\Administrator\\Desktop\\10_8.txt"))
                ){
            while ((str=in.readLine())!=null){
                System.out.println(str);
                out.write(str);
                out.newLine();
            }
            out.flush();
        }
        catch (IOException ioe){
            System.out.println("错误！"+ioe);
        }
    }
}
